perm filename USEM11[ZZZ,LCS] blob
sn#439880 filedate 1979-05-08 generic text, type T, neo UTF8
********** Using the Stanford-IRCAM MUSIC Program **********
******* WORK IN PROGRESS -- FEB 79 -- LELAND SMITH *********
This manual is designed for use with the PDP10 at the Stanford AI
lab. In most cases this text will also apply to the program in use
at the IRCAM lab in Paris.
MUS11 is a complete sound generating package which exists on the
disk. For first attempts type:
R MUS11
(All lines must be terminated with the 'RETURN' key.)
At this point the program will type the message:
INPUT?
Basically there are two responses possible. If the program is to
receive further instructions from another file which has been
prepared with an editing program, type:
NAME -- where NAME is the name of the file to be read.
(This program only reads files with no extension
or with the extension .DAT.)
If instructions are to be entered by means of the teletype keyboard
(TTY mode), type carriage return (<CR>).
At this point the sign (>) will appear which means the program is
awaiting input.
Most complete statements to be read by MUS11 must end with a
semicolon. Several complete statements may be entered on a single
line but it is best not to have the lines too long. More than one
line may be used for a single statement. If the less-than sign (<)
appears everything following on that line will be ignored. Use this
for entering comments.
***** Note that the above rules DO NOT apply to the syntax
of the SCORE program.
Already present in MUS11 is an "instrument" known as SIMP which has
been set to play a test tone of 'A' (440 hz) for 1/2 second.
In order to play this tone, first get into TTY mode as described
above, then type:
SIMP;FINISH; (The statement 'PLAY;' is not needed.)
When the computation ends "TEST.SND" will be typed out. This means
that sound data has been written on the disk under the name
"TEST.SND." You will also be given other information such as the
maximum amplitude encountered, the number of bits per sample, etc.
Immediately after this the following message will appear:
PLAY? At this point hitting <CR> will cause
computed sound to play (unless someone else's program has momentary
control over the devices you need.) Each time you hit the "RETURN"
key the process will be repeated.
The sound will be playing at SPEED 1. Type S to change the playback
speed. Then you must type a number from 0 to 5 to set the playback speed.
0 plays 1/2 as fast as 1, hence an octave lower; 2 plays twice as fast; 3
plays four times as fast; 4 plays eight times as fast; 5 plays sixteen
times as fast. If you type "X" the program will exit from the "play" mode
and return to 'INPUT?', which means it is waiting for some new command.
The speed at which the sound will play is determined by the sampling
rate which was used during the computation. The default sampling
rate in 'MUS11' is 12800. (See later on how to change this.)
If you have typed an "X" but wish to return to "play" mode, type %
to the question 'INPUT?'.
******************************************************
The instrument SIMP has five parameters.
P1 = begin time of note (in seconds)
P2 = duration of note " "
P3 = pitch
P4 = amplitude
P5 = wave form (or timbre)
P1 and P2 will have the same significance in all instruments but all
higher numbered parameters are assigned roles according to
convenience. (However it will prove useful to apply P3 and P4
consistently as above.)
Internally all pitch entries become numerical, however the twelve
frequencies of the tempered chromatic scale, from middle C (261.62
hz) up to B may be used in MUS11 by typing the letter names of the
notes. The letters S = # and F = flat.
Since these letters merely represent the frequencies of each note,
the octave range may be changed by multiplying or dividing by
multiples of two. Thus C or A in the octave below middle C would be
entered as C/2 or A/2. In the octave above the basic middle octave
these notes would be C*2 or A*2.
C -- 2 octaves down would be C/4
C -- 3 octaves down would be C/8
C -- 2 octaves up would be C*4
C -- 3 octaves up would be C*8 etc.
To test the use of these letters try:
P3←C;SIMP;FINISH; ('FINI;' may be used in place of 'FINISH;')
Now instrument SIMP will compute middle C instead of A. The left
arrow (←) indicates that the value of C has been placed in P3,
replacing any value that was previously there. (The left arrow and
the equals sign[=] are interchangeable in this program. In some
printings the left arrow will appear as an "underline"[_]. Try not
to be confused by this.)
SIMP;FINISH; must be typed so the new note will be computed.
After it is first heard it may be repeated as indicated above.
If frequencies other than those of the tempered scale are to be
played, a number may be used instead of a letter.
P3=1000; SIMP;FINISH; will play a tone at 1000 hz.
The amplitude scale available is the range of numbers from 0 to 2047.
(This upper limit is set by the number of bits [12] used for the
sound samples. See appendix.) P4 has been set at 1000 for the test
tone. This may be reset using the same method as described before.
P4=100;P3=GS*2; SIMP;FINISH;
This will play a G# above the middle octave at amplitude 100.
The duration of the tone may be changed be resetting P2.
P2=.1; will play a note of 1/10 sec. duration.
In general, test tones should rarely exceed 1" duration.
When several parameters are to be changed at once the following
type-in format should be used:
SIMP 0 .2 FS/2 850;FINI;
This will play F# below middle C for 2/10" at an amplitude of 850.
(Please note that P5, the wave form for SIMP, will be dealt with
later.)
********** COMMAS **********
Commas may be used to separate the parameters and if nothing precedes
a comma the contents of that parameter remains unchanged. Also any
parameter numbers higher than the length of the list will not be
affected.
SIMP , .3, , 1200;FINISH; changes only P2 and P4.
******************************************************
A string of notes may be played with the following input:
SIMP 0 .2 C 1500;SIMP .2, , D;SIMP .4, , E;
SIMP .6, , C;FINISH;
In this case P1 must be updated for each note. (Never overlap an
instrument with itself. Distortion will occur.) P2, the note
duration remains unchanged, so the commas suffice for the last three
notes. P4, coming at the end of the list for the first note need
only be stated once if it is not to change.
Rests are created by simply leaving some time between the end of one
note (P1+P2) and the beginning of the next (the new P1).
SIMP 0 .2 C;SIMP .5;FINISH; will play C for 2/10",
rest for 3/10" and then play another C for 2/10".
********** FUNCTIONS **********
The wave form in P5 is entered by means of a name which is used by
the program to locate a list, or array, of numbers (512) which
describe the wave. The names used for this purpose will always be F
followed directly by a number. These arrays will be called
"functions."
There are 6 functions in MUS11 when you first run it. These can be
changed at any time. The functions present are F1, F2, F3, F4, F5 and
F6. F2 and F3 are used for envelopes, F1 describes a sine wave and
F4, F5 and F6 are more complicated timbres.
Functions are created
within MUS11 itself by means of two routines called SIN and SEG.
SIN is used to create composites made by adding various harmonics
together. The form of F1 could be changed in the following manner:
SIN 1 1 1 .5;
The first number tells MUS11 that you will define F1. The next three
numbers give the relative amplitudes of the first 3 harmonics.
If any harmonic is to be omitted, a zero must appear in the list.
In the example the ratios of harmonics 1, 2 and 3 will be 1:1:.5 .
To get harmonics up to the 5th in the ratios of .7:1:0:.2:.1 type--
SIN 1 .7 1 0 .2 .1;
The size of each number is important only in its
relation to the other amplitude numbers.
Several pairs may entered and harmonic numbers up to 256 may be used
but in practice great care must be taken to avoid the "foldover"
effect which occurs when frequencies higher than one half the
sampling rate are present. (See appendix.)
It should be pointed out that the fundamental (harmonic #1) need not
be present in a wave.
SIN 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1; will give the three notes
of a minor chord (i.e. harmonics number 10, 12 and 15). After this
has been entered the following will cause a C minor chord to play:
SIMP 0 .5 GS/8;FINISH;
While the lowest Ab (or G#) on the piano keyboard has been indicated,
since the wave form includes only the 10th, 12th and 16th harmonics,
the notes middle C, Eb and G will be heard.
Several experiments with different wave forms should be made.
A function may be changed in the middle of a PLAY routine but it must
be noted that the new wave definition must follow! the note which it
is to affect.
In SIMP 0 .3 D 1000; SIMP .3;
SIN 1 .7 0 .2 0 .1 ;
SIMP .6,,E; FINISH;
the newly defined wave will be heard in the second and third notes.
The following example will play a sequence of notes wherein are heard
the 10th, 14th and 18th harmonics of a low C, then the 10th, 13th and
16th, and finally the 10th, 12th and 14th harmonics.
SIN 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 ;
SIN 2 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 ;
SIN 3 0 0 0 0 0 0 0 0 0 1 0 1 0 1 ;
SIMP 0 .3 C/4 2000 F1;
SIMP .3,,,,F2;SIMP .6,,,,3;FINISH;
From this point on it would probably be better to prepare any
input for MUS11 which requires more than a couple of lines of typing
with the SOS or ET editors. Typographical errors are inevitable and
when an error is made near the beginning of a string of input typed
directly to MUS11 you most likely will have to retype everything.
MUS11 will NOT read ET directory pages -- so all ET editing must be
done using the the /N feature (supresses the directory).
If SOS is used, the line numbers must be removed with the COPY
program. (Type 'COPY NAME/N' to remove line numbers from file NAME.)
A type of flow-chart diagram for SIMP would appear as follows:
P4 FP3
! !
! !
***************
* * OSC
* *
* P5 *
* *
* *
*********
B2 !
!
*****
* OUT *
* B1 *
*****
The top left input, P4, serves simply as a multiplier for the numbers
found in the wave form array, P5. The particular number from the
array to be multiplied is determined by the number in the upper right
input. The upper right input, in this case FP3, when processed by
the "translator" in MUS11 becomes the increment, the rate at which
the wave form array is stepped through. 'FP' stands for 'frequency'
parameter, i.e., a parameter which is to be converted to the proper
increment number to act as a frequency (how many TIMES per second).
This is opposed to a 'duration' parameter, 'DP', which converts to
act as a duration (how many SECONDS to go through the function).
The maximum size of the numbers in the wave array is + or -1. Thus
if P4 is set to 1000 the output of the OSC will be numbers in the
range +1000 to -1000 which will describe the wave form put into P5
cycling at the rate given in P3.
The code for entering this instrument follows:
INS 1;
SIMP
;
OSC P4 FP3 B2 P5;
OUT B2 B1;
END;
The 2nd number after 'INS' (the 1st is a dummy) gives the number for
this particular instrument definition.
After the 'INS' statement all the names to be associated with this
particular intrument number may be listed. A semicolon MUST appear
in column 1 to end the list of names. Currently a total of 27
different names can be used and 15 different instrument definitions.
Instrument names can have no more than FOUR letters and must not be
the same as any of the program's reserved words. (To see a list of
reserved words, type <CR> and then WORD; <CR>.)
This instrument has only one unit generator (the OSC) hence the
output (in B2) is added to the contents of B1 in the OUT box. If there
are several instruments the outputs of all the instruments will be
combined in B1 for each sample. B1 is a storage array of 512 words.
Every time B1 is filled its contents will be written on the disk.
It will be noticed when playing instrument SIMP that the sound begins
and ends quite abruptly. This is because no attack-decay envelope
has been applied to the tone. The sound begins at the full amplitude
of P4 and remains at that level for its total duration.
To apply an envelope, another unit generator must be added.
P4 P2
! !
! !
***************
* * OSC
* *
* P5 *
* *
* *
*********
B2 !
! FP3
! !
! !
***************
* * OSC
* *
* P6 *
* *
* *
********* INS 2
B2 ! TOOT
! ;
***** OSC P4 P2 B2 P5;
* OUT * OSC B2 FP3 B2 P6;
* B1 * OUT B2 B1;
***** END;
To create this instrument the definition listed above must be typed
in. Now that the instrument has been expanded you will note that it
is the output of of the second OSC which goes to OUT. Note that B2
through B6 may be reused several times in an instrument.
P2 will have the duration of each note to be played. DP2 could be
used but MUS11 always expects P2 to be treated as a duration anyway.
P5 will now contain the envelope array. This array is best defined
by the SEG routine. SEG defines the positions of line segments used
to approximate a curve. With SEG several pairs of numbers may be
entered. After the first number, which defines the function number,
the first number of each pair is an amplitude, normally in
the range of 0 to 1, and the second is the step number in the array.
The step numbers 1 through 100 are used in SEG. (However the step
numbers are converted internally to 512 array locations.) Straight
line segments are drawn between each of the points defined. The
following would put a triangular envelope shape into F3.
SEG 3 0,1 1,50 0,100;
Note that the routine is terminated when step 100 is reached.
After having typed in the code for instrument TOOT and the definition
for an envelope in F3, the following will produce a note using that
envelope:
SIN 1 1 .4 .1 ;< Sets the tone color.
TOOT 0 .5 A 2000 F3 F1;FINISH;
If two envelopes are to be contrasted add another function and define
it.
SEG 2 0,1 1,7 .2,25 .1,60 0,100;< Staccato
TOOT 0 .2 1000 2000 F2 F1; < P5 has envelope
TOOT .2 .5,,,F3;
FINISH; < Plays stac. then sust.(F2 then F3)
In the next example a unit generator will be added above the right
side of the bottom, tone producing unit generator. In this way a
function may be used to describe fluctuations of pitch within the
duration of a note -- much as the previous example gave the
possibility for changing the amplitude during a single note.
FP7 FP3
! !
_!___!_
\ / SUB
\ - /
\_/ DP8
P4 P2 B3 ! !
! ! ! !
! ! ***************
*************** * * OSC
* * OSC * *
* * * P9 *
* P5 * * *
* * * *
* * *********
********* FP3 B3 !
B2 ! ! _____________!
!________ _!___!_
! \ / AD2
! \ + /
! \_/
! ! B3
! !
***************
* *
OSC * *
* P6 *
* *
* *
********* INS 3;
B2 ! GLIS
! ;
! SUB FP7 FP3 B3 ;
***** OSC B3 DP8 B3 P9 ;
* OUT * AD2 B3 FP3 B3 ;
* B1 * OSC P4 P2 B2 P5 ;
***** OSC B2 B3 B2 P6;
OUT B2 B1;
END;
The top unit generator, 'SUB' causes the 2nd input to be subtracted
from the 1st. In this case P3 will have the starting frequency of
the glissando and P7 will have the frequency of the goal of the
glissando. (These are both frequencies, hence, FP7 and FP3.)
Since P3 will be entered further down, at this point we use the SUB
box to get the difference between the two frequencies, which, after
being processed by the next OSC, will be added to P3 at the AD2 box.
In order for this instrument to perform glissandos, a third function
must be defined for P9 (the "shape" of the glissando). A straight
line slope will suffice for a simple glissando. After typing in the
instrument definition set up the three functions.
SEG 5 0,1 .8,7 1,12 1,90 0,100;<Envelope
SEG 6 0,1 1,100; <Slope
The following will play a glissando up two octaves, from C to C*4.
GLIS 0 1 C 2000 F5 F1 C*4 1 F6; FINISH;
If P8=.5; (while P2 remains at 1) two glissandos will be heard.
(Note that P8 is listed in the instrument as DP8, a duration.)
This instrument may be used for a dramatic demonstration of
"foldover", the phenomenon which occurs when a frequency exceeds the
upper limit of one half the sampling rate. (See Mathews' book for a
technical explanation.)
For this purpose it is best to use a Sine wave in P6.
SIN 1 1 ; <note that this original form of F1
GLIS 0 1 1000 2000 F5 F1 4000 1 F6;FINISH;
This first note will slide up from 1000 hz to 4000 hz.
GLIS 0 1 1000 2000 F5 F1 11800 1 F6;FINISH;
Due to "foldover" (at 12800/2 hz.) this note will slide up to 6400 hz
and return to the 1000 hz level even though 11800 hz was given in P7.
The general rule for "foldover" is that any frequencies which exceed
one half the sampling rate will be heard at (SRATE-F) hz.
Try this one!
GLIS 0 1 0 2000 F5 F1 30000 1 F6; FINISH;
This same instrument may be used to produce a vibrato by putting a
sine wave into P9, setting P8=1/7; (the vibrato rate will be 7 times
per second) and making P7 some very small amount different from P3.
GLIS 0 1 C 2000 F5 F1 C+2 1/7 F1; FINISH;
(It is assumed that F1 is a sine wave.)
Various types of noise and other random fluctuations are
produced by the two random number unit generators. These are called
RAH and RAN. RAH (H=hold) produces in effect a function made
up of horizontal lines at various levels with a perpendicular jump
from one level to the next. There are two inputs to RAH. The
first (left hand) gives the range, plus or minus, of random
selection and the second (right hand) gives the rate (per second) at
which the selections are to be made.
Care must be taken with the number in the first input. If
the number 100 is given, the output of RAH will fluctuate between
+100 and -100. Thus if a range of 100 to 200 is desired, the input
number should be 50 and the number 150 must be added to the output.
FP7 FP8
P4 P2 ! !
! ! ! !
! ! ***************
*************** * *
* * OSC * RAH *
* * ***************
* P5 * B3 !
* * !
* * !
********* FP3 !
B2 ! ! _____________!
!________ _!___!_
! \ / AD2
! \ + /
! \_/
! ! B3
! !
***************
* *
OSC * *
* P6 *
* * INS 1;
* * NOIS
********* ;
B2 ! OSC P4 P2 B2 P5;
! RAH FP7 FP8 B3;
***** AD2 B3 FP3 B3;
* OUT * OSC B2 B3 B2 P6;
* B1 * OUT B2 B1;
***** END;
SEG 2 0,1 .8,7 1,12 1,90 0,100;<Env.
The following will produce white noise.
SRATE=25600;
NOIS 0 .5 C*8 1000 F2 F1 P3 P3*8;FINISH;
Actually P8 (given as P3*8) can probably be left at a number
like 4000 for noise purposes. As P7 is changed the apparent
band-width of the noise will be changed. As the band-width gets
narrower the center frequency becomes more apparent. Thus if P7=P3/16
and P3 is up in the range of C*8, something of the effect of blowing
across an open tube will be produced. The pitch is clear -- but
quite windy.
The SRATE (sampling rate) must be increased for noise
production since very high frequencies are essential. At SRATE=25600
the high frequency cut-off will be at 12800 hz.
If P8 is set to a low number (e.g. 8) individual random
pitches, instead of noise, will be produced at that rate.
If the random unit generator is replaced by a RAN the
random function produced will be made up of a series of slopes
(interpolation) up and down from one random point to another. In
the case of noise production there is little difference between RAN
and RAH. However RAN is necessary for getting such things as
random vibrato. The following will produce an acceptable, "human"
sounding vibrato.
NOIS 0 1 C*2 1000 F2 F1 P3*.01 16; FINISH;
The random rate of 16 per second (in P8) is considerably
faster than the human vibrato rate of 5 to 8 per second. In this
case however since the full band-width (in P7) is only seldom
attained and the heard effect is that of a rate much slower than 16.
With an ordinary OSC there is no simple way to have a long note
keep the same characteristics of attack and decay as a short note.
The ENV unit generator is used to create envelopes with separate
controls over attack time, steady state and decay time.
DP7 DP8 DP9
! ! !
P4 ! ! ! P10
! *************** !
! * * ! ENV
! * * !
!___ * P5 * ___!
* *
* *
***************************
B2 !
! FP3
! !
! !
***************
* * COS
* *
* P6 *
* * INS 3;
* * ENV
********* ;
B2 ! ENV P4 P5 B2 DP7 DP8 DP9 P10;
! COS B2 FP3 B2 P6;
***** OUT B2 B1;
* OUT * END;
* B1 *
*****
The parameter arrangement for ENV is rather different from that for
OSC. The far left parameter (P4) is, as usual, an amplitude input.
The next item in the parameter list (P5 here) will contain the
envelope array name. The next three (P7, P8 and P9 in this particular
example) will receive the attack duration, the total duration and the
decay duration of the envelope, in that order.
The 2nd parameter (P8) of this group could have been P2. However
since P2 is always a special parameter which tells how long the
instrument is to be turned, its use to indicate the total duration
of the envelope would make it impossible to play several notes within
one envelope cycle (a phrase.)
P10 plays a very special role. Normally the number 1 should be in
this parameter when there will be only a single note heard in the
duration of each complete envelope. (The 1 causes the main pointer
to be initialized at the start of each new note.) If, however, two or
more notes are to be played in the duration of one pass through the
envelope, P10 must be set to 0 for the first note (the "attack note")
and then all subsequent notes under the same envelope will have P10
set to -1. (The -1 tells ENV to NOT reinitialize its pointer.)
In the first case above (where P10=1) an instrument using the ENV
generator can be used to play on top of itself like any other
instrument. However, if the continuation feature is used, (P10=0 and
then P10=-1) there can be NO overlapping of notes with this instru-
ment (because the main pointer would get confused). In this latter
case several copies of the instrument code must be made, each with a
different instrument number. Thus a chord could be played by instru-
ments 1, 2 and 3, but not by instrument 1 playing 3 notes at once.
To summarize:
P10=1=NO CONTINUATION, REINITS EACH NOTE, CAN PLAY ON TOP OF SELF.
P10=0=INITS CONTINUATION FOR SEVERAL NOTES UNDER 1 ENV.
P10=-1=CONTINUATION (USE DIFFERENT INS. NUMS FOR CHORDS!!)
(**** When using -1 in a parameter list be sure to precede it by a
comma. e.g. .04, -1; might appear for P9 and P10. *****)
The array used for ENV must be defined in a special way. Only the
first 3/4 of the available locations are to be used. When using SEG,
steps 1-25 are reserved for the attack portion, steps 26-50 for the
"steady state" and steps 51-75 for the decay portion. Steps 76-100
are ignored by ENV but must be included in the SEG input in order
for the SEG routine to conclude properly. To test the properties of
ENV it is best to construct an envelope with dramatic changes.
SEG 2 0,1 1,3 .3,25 1,50 0,75 0,100; <F2 ENVELOPE
If parameters 7, 8 and 9 are set properly, this array will give a
sharp attack followed by a return to a low amplitude (.3) at the
start of the "steady state" section. Following there will be a
relatively slow crescendo to full amplitude and then a rapid decay.
It must be emphasized that the sum of the values given for P7 and P9
(attack and decay) must never exceed the value of P8 (total
duration.) Likewise, P8 should never be less than P2, (the total time
the instrument is turned on for a single note.) To visualize the true
shape of the envelope for any particular note duration (ND) consider
that the time spent in the middle section of the array (SS="steady
state" area) will be what is left when the attack (AT) and decay (DK)
are subtracted from the total duration (TD.)
SS = TD - AT - DK
SRT←12800;
ENV 0 1 A 2000 F2 F5 .08 1 .08 1; FINI;
In the following, the 2 notes D, F will be connected (phrased) and
the 3rd note, C#, will be detached. Notice that the first value
given in P8 (total duration of envelope) represents the total
duration of the first 2 notes. P8 is changed to equal P2 for the
separate note.
ENV 0 .5 D 2000 F2 F1 .08 1 .08 0;
P10=-1;
ENV .5 .5 F; < P4 to P9 remain the same.
ENV 1 .5 CS 2000 F2 F1 .08 .5 .08 1;
FINI;
You will have noticed that the last unit generator in this instrument
is called a COS. This is exactly like an OSC except that the
pointer to the array is never re-initialized. This allows the wave
form produced to be continuous from one note to the next. (The "C"
indicates it is a "continuing" oscilator). If an OSC were used in
this situation, clicks would often be heard between phrased notes.
Frequency modulation allows for the production of a wide
variety of tone colors using relatively little compute time.
P8___ ___P7
_!___!_
\ /
SUB \ - /
\_/ _ FP9
B3 !__ / \ /
\ / \/
/ X \ MLT
\ /
\ /
\_/ P2
B3 ! !
! !
*************** FP9 _ P7
OSC * * \ / \ /
* * \/ \/
* P10 * / \ MLT
* * \ X /
* * \ /
********* \_/
B3 !_______ _________! B5
! !
_!___!_
\ /
AD2 \ + / FP9
P4 P2 \_/ !
! ! B3 ! !
! ! ! !
*************** ***************
* * OSC * * OSC
* * * *
* P5 * * F1 *
* * * *
* * * *
********* FP3 *********
B4 ! ! _____________! B3
!________ _!___!_
! \ /
! \ + / AD2
! \_/
! ! B3
! !
*************** INS 1;
* * FM
NOS * * ;
* P6 * SUB P8 P7 B3;
* * MLT B3 FP9 B3;
* * OSC B3 P2 B3 P10;
********* MLT FP9 P7 B5;
B4 ! AD2 B3 B5 B3;
! OSC B3 FP9 B3 F1;
***** AD2 FP3 B3 B3;
* OUT * OSC P4 P2 B4 P5;
* B1 * NOS B4 B3 B4 F1;
***** OUT B4 B1; END;
You will notice that the last OSC is here changed to a NOS.
This is necessary because FM often requires that the frequency
given the last unit generator is negative. If an OSC were
used here an error would result.
The following functions should be set up to test the FM instrument.
SIN 1 1 1 ; < A sine wave.
SEG 2 0,1 .9,4 1,8 1,72 .8,88 .5,95 0,100; < Envelope
SEG 3 0,1 1,100; < An upward slope or ramp.
The following will produce a shift from a pure sine tone to a
highly modulated tone over a period of 2 seconds.
FM 0 2 100 1000 F2 F1 0 10 100 F3 F1; FINI;
To reverse the procedure, i.e. change from the modulated tone
to the pure tone, reverse the values of P7 and P8.
P7=10; P8=0; FM;FINI;
Change F2 (the ramp) to make the modulation emerge only in
the mid-part of the note.
SEG 2 0,1 1,50 0,100; < Makes a triangle.
FM;FINISH;
Try several of the variations suggested in Chowning's article on FM.
********* STEREO SOUND ***************
P4 P2
! !
! !
***************
* * OSC
* *
* P5 *
* *
* *
*********
B3 !
! FP3
! !
! !
***************
* * OSC
* *
* P6 *
* *
* * P8 P7
********* _!___!_
B3 ! \ /
! \ - / SUB
/ \ B2 \_/
P7 / \ __!
\ _ / \ _ / CHA=2; <THE = IS NEEDED.
\/ \/ \/ \/ INS 8;
/ X \ / X \ STER
MLT \ / \ / MLT ;
\ / \ / OSC P4 P2 B3 P5;
V V OSC B3 FP3 B3 P6;
B4 ! B5 ! MLT P7 B3 B4;
!____ ____! SUB P8 P7 B2;
\ / MLT B3 B2 B5;
! ! STR B4,B5,B1;
***** END;
* STR *
* B1 *
*****
Any instrument may have stereo capability by simply replacing
the last unit generator OUT with STR (=stereo). CHA or NCHNS is
normally set to 1 in MUS11. For stereo CHA must be set to 2. This
causes the sound samples to be multiplexed. That is, the odd numbered
samples will be for channel A and the even numbered samples will be
for channel B. (Thus twice as many samples are computed for the same
duration of sound.)
In the above example the use of P8=1 and a number between zero
and 1 in P7 will control the stereo position. If P7←1 all the sound
will be directed to channel A. If P7←0 allthe sound will be directed
to channel B. When P7=.5 then 50% of the sound will go to each
channel. Try the following:
STER 0 .3 A 1000 F2 F1 1 1; P7←0; STER .4; FINISH;
Note that a unit generator may replace P7. Thus, depending upon
the shape of the function used, a single, continuous sound may be
caused to move from channel to channel.